import request from '../utils/request';
import { API_PATHS } from '../constants/api';

// 产品列表查询参数接口
export interface ProductListParams {
  current?: number;
  size?: number;
  name?: string;
  category?: string;
  status?: string;
  [key: string]: any;
}

// 产品信息接口
export interface ProductInfo {
  id: string;
  productName: string;
  mainImage: string;
  price: number;
  productType: string;
  industryCategory: string;
  productZone: string;
  status: string;
  createdAt: string;
  auditStatus: string;
  companyName: string;
  serviceProvider: string;
  serviceRatio: string;
  briefIntroduction: string;
  productDescription: string;
}

// 分页响应接口
export interface PaginationResponse<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
}

// 获取产品列表
export async function getProductList(params: ProductListParams): Promise<PaginationResponse<ProductInfo>> {
  const response = await request.post(API_PATHS.PRODUCT.LIST, params);
  return response.data;
} 